package de.unimannheim.ki.tests;

import java.util.List;

import de.unimannheim.ki.algorithmn.LikeDisJoint;
import de.unimannheim.ki.algorithmn.LikeHammingJoint;
import de.unimannheim.ki.algorithmn.NNAlgorithm;
import de.unimannheim.ki.algorithmn.Neighbour;
import de.unimannheim.ki.databaseentities.Musicuser;
import de.unimannheim.ki.usermanagement.DatabaseUserDAO;

public class SimpleAlgoTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		DatabaseUserDAO dao = DatabaseUserDAO.getDAO();
		List<Musicuser> allUsers = dao.getAllUsers();
		System.out.println(allUsers.size());
		Musicuser testuser = dao.getUser("504286650");


		NNAlgorithm nn = new NNAlgorithm(new LikeHammingJoint());
		List<Neighbour> neighbours = nn.computeNeighbours(testuser);
		
		for (int i = 0; i < neighbours.size(); i++) {
			if(neighbours.get(i).getDistance() > 0.1) System.out.println(neighbours.get(i).toString());
		}

	}

}
